var fileEntry;
var viewerUrl;

var browser = document.querySelector('webview');

onresize = resizeBrowser;

document.querySelector('body').onload = function () {
    resizeBrowser();
    console.log('body.onload is called');

//    document.querySelector('#home').onclick = function () {
//        browser.src = "http://ca.yahoo.com/";
//    };

    if (browser) {
        setTimeout(function () { browser.src = viewerUrl; }, 3000);
    }

}

function resizeBrowser() {
    if (browser) {
        var windowWidth = document.documentElement.clientWidth;
        var windowHeight = document.documentElement.clientHeight;
        browser.width = windowWidth;
        browser.height = windowHeight;
    }
} 


console.log(launchData);

// Setup any launch data.
if (launchData) {
    console.log('launchData is received. Value = ' + launchData);
    viewerUrl = launchData;
} else {
    console.log('launchData is NOT received');
}
